<template>
    <div class="goodDesc-container">
        <h3>{{desc.title}}</h3>
        <hr>
        <div class="content">{{desc.content}}</div>
    </div>
</template>

<script>
    import { Toast } from 'mint-ui'
    export default {
        data(){
            return{
                id:this.$route.params.id,
                desc:{},
            }
        },
        created(){
            this.getGoodDesc();
        },
        methods:{
            getGoodDesc(){
                this.$http.get('http://127.0.0.1:3001/getGoodDesc?id='+this.id).then((result)=>{
                    if(result.body.code === 0){
                        this.desc = result.body.gooddesc
                    }else{
                        Toast('您的网络抽风了');
                    }
                }).catch(function (err) {
                    console.log(err);
                })
            }
        }
    }
</script>

<style scoped lang="less">
    .goodDesc-container{
        padding: 5px;
        h3{
            font-size: 14px;
            text-align: center;
            color: #0AB4F7;
            min-height: 40px;
            line-height: 40px;
        }
    }
</style>